<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page import="com.conversationboard.model.*" %>
<%@ page import="com.conversationboard.view.*" %>
<%@ page import="com.conversationboard.config.*" %>
<%@ page import="java.security.*" %>
<%@ page import="java.util.List"%>
<%@ page import="com.conversationboard.cache.newanswers.NewAnswersThread"%>
<%@ page import="com.conversationboard.site.Site"%>

<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>

<% 
	Board board = (Board) request.getAttribute("board");
	List<NewAnswersThread> threads = (List<NewAnswersThread>) request.getAttribute("threads");
	String userId = (String) request.getAttribute("userid");
	int offset = Integer.parseInt((String) request.getAttribute("offset"));
	
	String postbackParameters = "?boardid=" + board.getBoardId() + "&amp;offset=" + offset;

	Principal principal = request.getUserPrincipal();
	
%>


<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title><%=board.getName()%>: New <%= Site.getThread() %>s</title>
		<link rel="stylesheet" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
		
		<c:if test="${user.admin}">
			<script src="${contextPath}/Javascript/style.js" type="text/javascript"></script>
		</c:if>
		
	</head>

	<body>
	
		<%=MenuDisplay.display(board, false, principal)%>

		<div class="headingblock">
			<h1><%=board.getName()%>: New <%= Site.getThread() %>s</h1>
		</div>

		<div class="mainblock">
			<%=ThreadListDisplay.display(board, threads, userId, OrderedBy.CREATION_DATE) %>
			
			<br /><br />
			
			<a href="<%=Configuration.getInstance().getRoot()%>/RecentQuestionsControllerServlet<%=postbackParameters%>">Next...</a>
			
		</div>
	
		<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
		<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 
	
	</body>
	
</html>
